﻿@model CommerceOne.Models.RegistrationViewModel

<div id="center_column" class="center_column">
<!-- Breadcrumb -->
     @Html.Partial("_Breadcrumb", @Model.Breadcrumb)
<!-- /Breadcrumb -->
<h1>Create your account</h1>

<!-- Steps -->
@Html.Partial("_CheckoutStep", @Model.Step)
<!-- /Steps -->

@using(Html.BeginForm("Registration", "Authentication", FormMethod.Post, new { @class = "std", id = "account-creation_form" }))
{
    @Html.ValidationSummary(true)
    
	<fieldset class="account_creation">
		<h3>Your personal information</h3>
		<p class="radio required">
			<span>Title</span>
            @Html.RadioButtonFor(x=>x.Contact.Title, "Mr.", new { id="id_gender1", name="id_gender"})
            @Html.Label("id_gender1", "Mr.")
            @Html.RadioButtonFor(x=>x.Contact.Title, "Ms.", new { id="id_gender2", name="id_gender"})
            @Html.Label("id_gender2", "Ms.")

            @Html.ValidationMessageFor(x => x.Contact.Title)
		</p>
		<p class="required text">
			<label for="customer_firstname">First name</label>
            @Html.TextBoxFor(x => x.Contact.FirstName, new { id="customer_firstname", name="customer_firstname" })
            <sup>*</sup>
			@Html.ValidationMessageFor(x => x.Contact.FirstName)
		</p>
		<p class="required text">
			<label for="customer_lastname">Last name</label>
            @Html.TextBoxFor(x => x.Contact.LastName, new { id = "customer_lastname", name = "customer_lastname" })
            <sup>*</sup>
			@Html.ValidationMessageFor(x => x.Contact.LastName)
		</p>
        	<p class="required text">
			<label for="company">Company</label>
            @Html.TextBoxFor(x => x.Contact.Company, new { id = "company", name = "company" })
			<sup>*</sup>
            @Html.ValidationMessageFor(x => x.Contact.Company)
		</p>
		<p class="required text">
			<label for="email">E-mail</label>
            @Html.TextBoxFor(x => x.Contact.EmailAddress, new { id = "email", name = "email" })
			<sup>*</sup>
            @Html.ValidationMessageFor(x => x.Contact.EmailAddress)
		</p>
		<p class="required password">
			<label for="passwd">Password</label>
			@*<input type="password" name="passwd" id="passwd" />*@
            @Html.PasswordFor(x => x.Contact.PasswordHash, new { id = "passwd", name = "passwd" })
			<sup>*</sup>
			<span class="form_info">(5 characters min.)</span>
            @Html.ValidationMessageFor(x => x.Contact.PasswordHash)
		</p>
		<p class="required select">
			<span>Date of Birth</span>
            @Html.TextBoxFor(x => x.Contact.BirthDay, new { @class = "date" })
            <sup>*</sup>
            (dd/mm/yyyy)
            @Html.ValidationMessageFor(x => x.Contact.BirthDay)
		</p>
        <p class="required text">
			<label for="security">Security question</label>
            @Html.DropDownListFor(x => x.Contact.QuestionID, new SelectList(Model.SecurityQuestions, "ID", "Question"), new { name = "security", id = "security" })
			<sup>*</sup>
            @Html.ValidationMessageFor(x => x.Contact.QuestionID)
		</p>
        <p class="required text">
			<label for="answer">Answer</label>
            @Html.TextBoxFor(x => x.Contact.Answer, new { id = "answer", name = "answer" })
			<sup>*</sup>
            @Html.ValidationMessageFor(x => x.Contact.Answer)
		</p>
	</fieldset>
	<fieldset class="account_creation">
		<h3>Your address</h3>
		<p class="text">
			<label for="company">Company</label>
			<input type="text" id="company" name="company" value="" />
		</p>
		<p class="required text">
			<label for="name">First name</label>
            @Html.TextBoxFor(x => x.Address.Name, new { id = "name", name = "name" })
			<sup>*</sup>
            @Html.ValidationMessageFor(x => x.Address.Name)
		</p>
		<p class="required text">
			<label for="address1">Address</label>
            @Html.TextBoxFor(x => x.Address.AddressLine1, new { id = "address1", name = "address1" })
			<sup>*</sup>
            @Html.ValidationMessageFor(x => x.Address.AddressLine1)
			<span class="inline-infos">Street address, P.O. box, compagny name, c/o</span>
		</p>
		<p class="text">
			<label for="address2">Address (Line 2)</label>
            @Html.TextBoxFor(x => x.Address.AddressLine1, new { id = "address2", name = "address2" })
            @Html.ValidationMessageFor(x => x.Address.AddressLine2)
			<span class="inline-infos">Apartment, suite, unit, building, floor, etc.</span>
		</p>
		<p class="required text">
			<label for="city">City</label>
            @Html.DropDownListFor(x => x.Address.CityId, new SelectList(Model.Cities, "ID", "Name"), new { name = "city", id = "city" })
			<sup>*</sup>
            @Html.ValidationMessageFor(x => x.Address.CityId)
		</p>
		<p class="required postcode text">
			<label for="postcode">Zip / Postal Code</label>
            @Html.TextBoxFor(x => x.Address.PostalCode, new { id = "postcode", name = "postcode" })
			<sup>*</sup>
            @Html.ValidationMessageFor(x => x.Address.CityId)
		</p>
		<p class="required select">
			<label for="id_country">Country</label>
            @Html.DropDownListFor(x => x.Address.CountryId, new SelectList(Model.Countries, "ID", "Name"), new { name = "id_country", id = "id_country" })
			<sup>*</sup>
            @Html.ValidationMessageFor(x => x.Address.CountryId)
		</p>
		<p class="textarea">
			<label for="other">Additional information</label>
            @Html.TextAreaFor(x => x.Address.Remark, new { name = "other", id = "other", rows="3", cols="26" })
		</p>
		<p class="required">You must register at least one phone number <sup>*</sup></p>
		<p class="text">
			<label for="phone">Home phone</label>
            @Html.TextBoxFor(x => x.Address.HomePhone, new {name="phone", id="phone" })
		</p>
		<p class="text">
			<label for="phone_mobile">Mobile phone</label>
            @Html.TextBoxFor(x => x.Address.MobilePhone, new { name = "phone_mobile", id = "phone_mobile" })
		</p>
		<p class="required text" id="address_alias">
			<label for="alias">Assign an address title for future reference</label>
            @Html.TextBoxFor(x => x.Address.AddressTitle, new { name = "alias", id = "alias" })
			<sup>*</sup>
            @Html.ValidationMessageFor(x => x.Address.AddressTitle)
		</p>
	</fieldset>
	<fieldset class="account_creation dni">
		<h3>Tax identification</h3>
		<p class="required text">
			<label for="dni">Identification number</label>
			<input type="text" name="dni" id="dni" value="" />
			<sup>*</sup>
			<span class="form_info">DNI / NIF / NIE</span>
		</p>
	</fieldset>
	<p class="required required_desc">
		<span><sup>*</sup>Required field</span>
	</p>
	<p class="submit">
		<input type="hidden" name="email_create" value="1" />
		<input type="hidden" name="is_new_customer" value="1" />
		<input type="hidden" class="hidden" name="back" value="my-account.php" />		
        <input type="submit" name="submitAccount" id="submitAccount" value="Register" class="exclusive" />
	</p>
}

</div>

@section HeaderScript
{
    $(document).ready(function () { $('.date').datepicker({ changeMonth: true, changeYear: true, dateFormat: "dd/mm/yy" }); });
}

   
